package base.Day05;

public class MethodDemo1
{
    // 重载  参数位置不同 数量不同  其他都不可以
    public static void main(String[] args)
    {
//        test();
//        test(3);   // 3为实参
//        test("oh yes , on a on yes",3);
//        ttt("what can I say manba out ",11);
//        ttt("what can I say manba out ",3);
    ttt();
    ttt("11");
    ttt("11",3);
    ttt(3,"11");
    }

    public static void test()
    {
        System.out.println("Man what can I say ? Man  ManBa out  hahahahahahahahaha");
    }

    public static void test(String content, int count)
    {
        for (int i = 0; i < count; i++)
        {
            System.out.println(content);
        }
    }

    public static void test(int count)
    {
        for (int i = 0; i < count; i++)
        {
            System.out.println("what can I say? man manBa out ,ha ha ha ha ha ha ");
        }
    }


    public static void test(int count1, String content1)    // 形参
    {
        System.out.println("....................");
    }

    public static void ttt(String content, int count)
    {
        if (count > 10)
            return;
        System.out.println("ttt with two args");

    }

    public static void ttt()
    {
        System.out.println("ttt without arg");
    }

    public static void ttt(String content)
    {
        System.out.println("ttt with a arg"+content);
    }
    public static void ttt(int count ,String s)
    {
        System.out.println("ttt with two arg plus"+count+s);
    }


    public static void ttt(int c,String s1,double d)
    {
        System.out.println("ttt with three args"+c+s1+d);
    }
    // 重载  函数签名=函数名+参数列表
    public static void m1(){};
    // 参数列表 名称不同不算重载 返回类型不同不算重载 ------参数数量不同 相同参数不同位置 算重载
    public static void m1(int a){};

    public static void m1(String s){};

    public static void m1(int a,String s){};

    public static void m1(String s ,int a){};

    public static int m1(int a,int b){return 1;};

    public static double m1(double a){return  1.2;};

    public static String m1(String s,int a,double a1){return "";} ;

    public static void m1(double a1 ,int a,String s){};

}
